package com.example.demo.controller;

import com.example.demo.Mappers.GetRegDeptListMapper;
import com.example.demo.beans.DepartInfoBean;
import com.example.demo.beans.GetRegDeptListResponse;
import com.example.demo.beans.GetRegDeptListrequest;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * Created by Administrator on 2018/4/12.
 */
@RestController
public class GetRegDeptListController {
@Autowired
    private GetRegDeptListMapper mapper;
@ResponseBody
   @RequestMapping(value = "GetRegDeptList",produces = {"application/xml"})
    public   GetRegDeptListResponse GetRegdep(@RequestBody(required = false)GetRegDeptListrequest request){
    GetRegDeptListResponse response=new GetRegDeptListResponse();
    if(request!=null){

        response.setResultCode("0");response.setResultMsg("查询成功");
        response.setItems(mapper.GetDepart());
     return  response;
      //  return  mapper.GetDepart();
    }
    response.setResultCode("1");
    response.setResultMsg("请求参数为空！");
    return  response;
}
}
